﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SFP.CollisionDetection;

namespace HamsterDelivery.LevelStructure.Reactions
{
    abstract class ReactionUtils
    {
        public static CollisionInfo collisionMaxOverlap(HashSet<CollisionInfo> collisionInfos)
        {
            CollisionInfo collisionMaxOvelap = null;

            foreach (CollisionInfo collisionInfo in collisionInfos)
            {
                if (collisionMaxOvelap == null)
                {
                    collisionMaxOvelap = collisionInfo;
                }
                else
                {
                    if (collisionInfo.Overlap > collisionMaxOvelap.Overlap)
                    {
                        collisionMaxOvelap = collisionInfo;
                    }
                }
            }

            return collisionMaxOvelap;
        }
    }
}
